# !/usr/bin/env python
# -*-coding:utf-8 -*-
"""
# Author     ：hu_cl
# Date       ：2022/4/20 14:19
# File       : test1.py
# Description：
"""
import datetime

info_list = [{'addr': '192.168.2.1', 'key': None, 'data': {'ip': '192.168.2.1', 'mac': 'E8:68:19:C9:68:92'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.2', 'key': None, 'data': {'ip': '192.168.2.2', 'mac': '9C:E3:3F:7C:88:A6'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.3', 'key': None, 'data': {'ip': '192.168.2.3', 'mac': '00:1E:08:15:F0:D7'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.5', 'key': None, 'data': {'ip': '192.168.2.5', 'mac': '34:36:3B:6F:96:EE'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.7', 'key': None, 'data': {'ip': '192.168.2.7', 'mac': '38:D2:CA:C2:92:2A'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.13', 'key': None, 'data': {'ip': '192.168.2.13', 'mac': '70:1C:E7:7C:34:A4'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.14', 'key': None, 'data': {'ip': '192.168.2.14', 'mac': '6C:92:BF:6B:D5:32'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.15', 'key': None, 'data': {'ip': '192.168.2.15', 'mac': '6C:92:BF:9B:DC:BE'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.16', 'key': None, 'data': {'ip': '192.168.2.16', 'mac': '6C:92:BF:9B:DF:A6'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.19', 'key': None, 'data': {'ip': '192.168.2.19', 'mac': 'F8:63:3F:BC:6F:D8'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.20', 'key': None, 'data': {'ip': '192.168.2.20', 'mac': '88:E9:FE:71:AC:36'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.26', 'key': None, 'data': {'ip': '192.168.2.26', 'mac': '18:CC:18:9F:0F:60'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.29', 'key': None, 'data': {'ip': '192.168.2.29', 'mac': '6C:92:BF:9B:DC:BC'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.30', 'key': None, 'data': {'ip': '192.168.2.30', 'mac': 'FC:D8:48:C9:60:82'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.31', 'key': None, 'data': {'ip': '192.168.2.31', 'mac': '00:0C:29:B6:1B:49'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.32', 'key': None, 'data': {'ip': '192.168.2.32', 'mac': '00:0C:29:5D:87:9F'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.40', 'key': None, 'data': {'ip': '192.168.2.40', 'mac': 'C8:69:CD:9D:E0:F2'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.44', 'key': None, 'data': {'ip': '192.168.2.44', 'mac': '00:0C:29:61:75:D7'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.45', 'key': None, 'data': {'ip': '192.168.2.45', 'mac': '00:0C:29:4E:BB:6E'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.49', 'key': None, 'data': {'ip': '192.168.2.49', 'mac': 'B0:FC:36:6A:CE:AF'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.50', 'key': None, 'data': {'ip': '192.168.2.50', 'mac': '10:40:F3:EA:AF:42'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.63', 'key': None, 'data': {'ip': '192.168.2.63', 'mac': '48:EA:63:EC:81:03'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.64', 'key': None, 'data': {'ip': '192.168.2.64', 'mac': 'BC:BA:C2:09:89:BB'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.65', 'key': None, 'data': {'ip': '192.168.2.65', 'mac': 'BC:32:5F:89:4F:B4'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.66', 'key': None, 'data': {'ip': '192.168.2.66', 'mac': 'EC:C8:9C:45:93:D2'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.70', 'key': None, 'data': {'ip': '192.168.2.70', 'mac': 'C2:D4:42:04:8A:6D'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.76', 'key': None, 'data': {'ip': '192.168.2.76', 'mac': '34:7C:25:7A:16:0D'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.77', 'key': None, 'data': {'ip': '192.168.2.77', 'mac': '14:98:77:6E:38:BA'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.80', 'key': None, 'data': {'ip': '192.168.2.80', 'mac': 'D2:FA:1E:14:5A:8F'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.85', 'key': None, 'data': {'ip': '192.168.2.85', 'mac': '92:97:D2:AA:AE:F3'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.89', 'key': None, 'data': {'ip': '192.168.2.89', 'mac': '0A:5F:AA:08:8A:C7'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.91', 'key': None, 'data': {'ip': '192.168.2.91', 'mac': '82:38:6D:2C:86:EE'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.95', 'key': None, 'data': {'ip': '192.168.2.95', 'mac': 'D8:12:65:18:13:A2'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.97', 'key': None, 'data': {'ip': '192.168.2.97', 'mac': '8C:45:00:0F:D9:B4'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.100', 'key': None, 'data': {'ip': '192.168.2.100', 'mac': '6C:92:BF:9B:DF:A4'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.102', 'key': None, 'data': {'ip': '192.168.2.102', 'mac': 'E6:E4:BB:C6:38:CA'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.110', 'key': None, 'data': {'ip': '192.168.2.110', 'mac': '6C:92:BF:6B:D5:30'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.113', 'key': None, 'data': {'ip': '192.168.2.113', 'mac': 'E4:AA:EA:E0:6A:4B'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.115', 'key': None, 'data': {'ip': '192.168.2.115', 'mac': '00:0C:29:9A:E7:53'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.118', 'key': None, 'data': {'ip': '192.168.2.118', 'mac': 'C6:2C:C8:F1:CB:B1'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.122', 'key': None, 'data': {'ip': '192.168.2.122', 'mac': '00:0C:29:F1:7A:8D'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.129', 'key': None, 'data': {'ip': '192.168.2.129', 'mac': '48:57:02:65:64:60'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.138', 'key': None, 'data': {'ip': '192.168.2.138', 'mac': 'F8:A2:D6:C3:82:0F'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.147', 'key': None, 'data': {'ip': '192.168.2.147', 'mac': 'E0:94:67:BB:EA:54'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.154', 'key': None, 'data': {'ip': '192.168.2.154', 'mac': '00:0C:29:27:88:82'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.157', 'key': None, 'data': {'ip': '192.168.2.157', 'mac': '00:0C:29:CA:85:C1'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.166', 'key': None, 'data': {'ip': '192.168.2.166', 'mac': 'BA:24:1C:39:DA:97'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.170', 'key': None, 'data': {'ip': '192.168.2.170', 'mac': '00:0C:29:3C:55:69'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.171', 'key': None, 'data': {'ip': '192.168.2.171', 'mac': '00:0C:29:19:6F:A8'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.172', 'key': None, 'data': {'ip': '192.168.2.172', 'mac': '00:0C:29:1F:BC:95'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.178', 'key': None, 'data': {'ip': '192.168.2.178', 'mac': 'F6:3C:F9:48:25:2D'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.182', 'key': None, 'data': {'ip': '192.168.2.182', 'mac': 'A6:BB:09:9C:2F:4B'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.188', 'key': None, 'data': {'ip': '192.168.2.188', 'mac': '12:10:02:3F:76:A6'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.189', 'key': None, 'data': {'ip': '192.168.2.189', 'mac': '38:37:8B:F5:2E:AD'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.193', 'key': None, 'data': {'ip': '192.168.2.193', 'mac': '72:6B:2A:C0:6B:C2'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.196', 'key': None, 'data': {'ip': '192.168.2.196', 'mac': '12:2D:EA:03:F3:78'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.199', 'key': None, 'data': {'ip': '192.168.2.199', 'mac': '0C:9D:92:C3:73:8B'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.203', 'key': None, 'data': {'ip': '192.168.2.203', 'mac': 'F8:28:19:CF:04:8D'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.211', 'key': None, 'data': {'ip': '192.168.2.211', 'mac': '2E:B2:77:78:DD:53'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.217', 'key': None, 'data': {'ip': '192.168.2.217', 'mac': 'E2:3C:61:2B:DC:22'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.229', 'key': None, 'data': {'ip': '192.168.2.229', 'mac': '06:94:89:55:27:E7'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.235', 'key': None, 'data': {'ip': '192.168.2.235', 'mac': 'B0:83:FE:E6:C9:9E'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.243', 'key': None, 'data': {'ip': '192.168.2.243', 'mac': '00:0C:29:68:01:AE'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.249', 'key': None, 'data': {'ip': '192.168.2.249', 'mac': 'B2:AD:46:2D:57:87'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.253', 'key': None, 'data': {'ip': '192.168.2.253', 'mac': '22:76:93:08:5C:AE'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.2.254', 'key': None, 'data': {'ip': '192.168.2.254', 'mac': '74:3A:20:9A:F7:63'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.1', 'key': None, 'data': {'ip': '192.168.13.1', 'mac': 'E8:68:19:C9:68:9E'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.99', 'key': None, 'data': {'ip': '192.168.13.99', 'mac': '08:00:27:53:BA:A0'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.101', 'key': None, 'data': {'ip': '192.168.13.101', 'mac': '08:00:27:F0:53:90'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.102', 'key': None, 'data': {'ip': '192.168.13.102', 'mac': '08:00:27:F0:53:90'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.123', 'key': None, 'data': {'ip': '192.168.13.123', 'mac': '6C:0B:84:90:05:10'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.188', 'key': None, 'data': {'ip': '192.168.13.188', 'mac': '08:00:27:58:70:CD'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.198', 'key': None, 'data': {'ip': '192.168.13.198', 'mac': 'C8:1F:66:C0:E5:C7'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.231', 'key': None, 'data': {'ip': '192.168.13.231', 'mac': '08:00:27:CF:65:34'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.232', 'key': None, 'data': {'ip': '192.168.13.232', 'mac': '08:00:27:13:92:4F'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.233', 'key': None, 'data': {'ip': '192.168.13.233', 'mac': '08:00:27:91:D7:2A'},
              'poros': 'snmp@arp'},
             {'addr': '192.168.13.234', 'key': None, 'data': {'ip': '192.168.13.234', 'mac': 'AC:1F:6B:D0:30:92'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.0.1', 'key': None, 'data': {'ip': '172.16.0.1', 'mac': 'E8:68:19:C9:68:98'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.1.83', 'key': None, 'data': {'ip': '172.16.1.83', 'mac': '0C:9D:92:63:7C:CA'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.2.11', 'key': None, 'data': {'ip': '172.16.2.11', 'mac': '0C:9D:92:63:74:69'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.2.144', 'key': None, 'data': {'ip': '172.16.2.144', 'mac': 'A4:1A:3A:B6:0E:A9'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.2.152', 'key': None, 'data': {'ip': '172.16.2.152', 'mac': 'D8:5E:D3:5A:2C:2B'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.2.181', 'key': None, 'data': {'ip': '172.16.2.181', 'mac': '0C:9D:92:63:7C:71'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.2.216', 'key': None, 'data': {'ip': '172.16.2.216', 'mac': '00:0C:29:54:3A:AC'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.5.44', 'key': None, 'data': {'ip': '172.16.5.44', 'mac': '00:0C:29:3E:DD:AB'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.5.45', 'key': None, 'data': {'ip': '172.16.5.45', 'mac': '00:0C:29:E8:E1:E9'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.6.11', 'key': None, 'data': {'ip': '172.16.6.11', 'mac': '00:15:5D:02:B3:30'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.6.67', 'key': None, 'data': {'ip': '172.16.6.67', 'mac': 'A4:1A:3A:B6:03:4C'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.6.111', 'key': None, 'data': {'ip': '172.16.6.111', 'mac': '00:15:5D:02:B3:0F'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.6.127', 'key': None, 'data': {'ip': '172.16.6.127', 'mac': '00:15:5D:02:B3:0B'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.6.179', 'key': None, 'data': {'ip': '172.16.6.179', 'mac': 'B4:2E:99:E9:57:EC'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.6.222', 'key': None, 'data': {'ip': '172.16.6.222', 'mac': '00:15:5D:02:B3:14'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.8.34', 'key': None, 'data': {'ip': '172.16.8.34', 'mac': '18:C0:4D:2E:F8:BC'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.8.45', 'key': None, 'data': {'ip': '172.16.8.45', 'mac': '00:0C:29:CD:38:DD'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.8.56', 'key': None, 'data': {'ip': '172.16.8.56', 'mac': 'E0:D5:5E:F8:8E:A1'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.10.100', 'key': None, 'data': {'ip': '172.16.10.100', 'mac': '00:0C:29:EE:A6:8F'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.10.147', 'key': None, 'data': {'ip': '172.16.10.147', 'mac': '00:E0:4C:75:87:AD'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.12.176', 'key': None, 'data': {'ip': '172.16.12.176', 'mac': '00:0C:29:42:12:D1'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.13.206', 'key': None, 'data': {'ip': '172.16.13.206', 'mac': '18:C0:4D:36:A4:1D'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.16.172', 'key': None, 'data': {'ip': '172.16.16.172', 'mac': '18:C0:4D:67:00:10'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.17.28', 'key': None, 'data': {'ip': '172.16.17.28', 'mac': '18:C0:4D:2E:FB:D5'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.17.227', 'key': None, 'data': {'ip': '172.16.17.227', 'mac': 'D8:5E:D3:5A:2C:1B'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.18.166', 'key': None, 'data': {'ip': '172.16.18.166', 'mac': '18:C0:4D:3E:0D:DF'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.22.205', 'key': None, 'data': {'ip': '172.16.22.205', 'mac': 'D8:5E:D3:5B:CB:45'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.23.103', 'key': None, 'data': {'ip': '172.16.23.103', 'mac': '0C:9D:92:CD:2B:5D'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.24.68', 'key': None, 'data': {'ip': '172.16.24.68', 'mac': '00:15:5D:02:B3:36'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.25.166', 'key': None, 'data': {'ip': '172.16.25.166', 'mac': '0C:9D:92:63:7C:68'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.25.245', 'key': None, 'data': {'ip': '172.16.25.245', 'mac': '6A:32:7B:76:41:62'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.26.8', 'key': None, 'data': {'ip': '172.16.26.8', 'mac': '18:C0:4D:2C:B3:06'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.29.196', 'key': None, 'data': {'ip': '172.16.29.196', 'mac': '18:31:BF:0B:5B:2B'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.30.45', 'key': None, 'data': {'ip': '172.16.30.45', 'mac': '40:6C:8F:2F:8F:45'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.168.168', 'key': None, 'data': {'ip': '172.16.168.168', 'mac': '18:C0:4D:2E:F9:67'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.222.222', 'key': None, 'data': {'ip': '172.16.222.222', 'mac': 'B4:2E:99:86:41:A4'},
              'poros': 'snmp@arp'},
             {'addr': '172.16.222.223', 'key': None, 'data': {'ip': '172.16.222.223', 'mac': '08:00:27:4A:B8:BE'},
              'poros': 'snmp@arp'}]

test_list = [{'a': 123, 'b': 1234},
             {'a': 3222, 'b': 1234},
             {'a': 123, 'b': 1234}]

if __name__ == '__main__':
    seen, new_l, new_index = [], [], []
    for d in info_list:
        t = d['data']['mac']
        if t not in seen:
            seen.append(t)
            new_l.append(d)
        else:
            new_index.append(seen.index(t))

    for i in new_index:
        del new_l[i]

    # li = [{'a': 1}, {'b': 2}, {'a': 1}]
    #
    # li = [dict(t) for t in set([tuple(d.items()) for d in li])]

# li = [dict(t) for t in set([tuple(d.items()) for d in info_list])]
